﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Xml.Linq;
using System.Linq.Expressions.Serialization;

namespace KPIS.GERP.WEB.GAMS.Classes
{
	public static class GERPDb
	{
		public static IEnumerable<T> Find<T>(Expression<Func<T, bool>> predicate, Expression<Func<T, object>>[] includes) where T : class
		{
			XElement predicateXElement  =  ExpressionSerializer.Serialize(predicate);
			List<XElement> includeXElements = includes.Select(ExpressionSerializer.Serialize).ToList();

			object predicateObject = (object) predicateXElement;
			object[] includeObjects = includeXElements.Cast<object>().ToArray();

			var typeName = typeof (T).Name;
			return null;
		}
	}
}